﻿<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
  <style type="text/css">
  body{
  font-size:12px;
  line-height:25px;
  margin:0 auto;
  color:white;}
  #header{
	  text-align:center;
  background-repeat:repeat-x;
  height:36px;
  }
  #headerLeft{  
  float:left;
  width:200px;
  }
  #headerRight{
  float:right;
  width:160px;
  }
  #main{
  margin:20px auto;
  background-color:lightgray;
  width:700px;
  text-align:center;
  }
 .righttd{
 text-align:right;
 width:100px;
 }
 .lefttd{
 text-align:left;
 width:400px;}
 table{
 align:center;
 color:black;}
 #btnSubmit{
 background-color:red;
 color:white;
 float:none;}
.red{
	color:red;
    float:left;}
input{
	float:left;}

  </style>
 <script type="text/javascript">
 function check(){
	var obj=document.getElementById("email");
	var objEmail=document.getElementById("email").value;
	var obj1=document.getElementById("pwd");
	var objpwd=document.getElementById("pwd").value;
	var obj2=document.getElementById("confirm_pwd");
	var objcpwd=document.getElementById("confirm_pwd").value;

	if(objEmail==""){
		alert("电子邮件不能为空");
		obj.select();
		obj.focus();
		return false;
		}
	if(objEmail.indexOf("@",0)==-1){
		alert("电子邮件格式不正确\n必须包含符合@");
		obj.select();
		obj.focus();
		return false;
		}
	if(objEmail.indexOf(".")==-1){
		alert("电子邮件格式不正确\n必须包含符合.");
		obj.select();
		obj.focus();
		return false;
		}
	if(objpwd==""){
		alert("密码不能为空");
		obj1.select();
		obj1.focus();
		return false;
		}
	if(objpwd.length<6){
		alert("密码长度不能小于6位");
		obj1.select();
		obj1.focus();
		return false;
		}	
	if(objpwd!=objcpwd){
		alert("两次输入的密码不一致");
		return false;
		}
var user=document.getElementById("user").value;	
        if(user==""){
		alert("姓名不能为空");
		return false;
		}
	for(var i=0;i<user.length;i++){
		//var j=user.substring(i,i+1);
		var j=user.charAt(i);
		if(isNaN(j)==false){
			alert("姓名中不能包含数字");
			return false;
			}
		}	
	return true;
	}

function clearText(){
	var mail=document.getElementById("email");
	if(mail.value=="请输入正确的电子邮箱"){
		mail.value=="";
		mail.style.borderColor="#ff0000";
		}
	}
	
function clearText1(){
	var user=document.getElementById("user");
	if(user.value=="请输入正确的姓名"){
		user.value=="";
		user.style.borderColor="#ff0000";
		}
	}

function checkEmail(){
	var obj=document.getElementById("email");
	var objEmail=document.getElementById("email").value;
	var objDiv=document.getElementById("showEmailError");
	if(objEmail==""){
		objDiv.innerHTML=("电子邮件不能为空");
		//obj.select();
		//obj.focus();
		return false;
		}
	if(objEmail.indexOf("@",0)==-1){
		objDiv.innerHTML=("电子邮件格式不正确\n必须包含符合@");
		//obj.select();
		//obj.focus();
		return false;
		}
	if(objEmail.indexOf(".")==-1){
		objDiv.innerHTML=("电子邮件格式不正确\n必须包含符合.");
		//obj.select();
		//obj.focus();
		return false;
		}
	}

function checkpwd(){
	var obj=document.getElementById("pwd");
	var objPwd=document.getElementById("pwd").value;
	var objDiv=document.getElementById("showEmailError");
	if(objpwd==""){
		objDiv.innerHTML=("密码不能为空");
		//obj1.select();
		//obj1.focus();
		return false;
		}
	if(objpwd.length<6){
		objDiv.innerHTML=("密码长度不能小于6位");
		//obj1.select();
		//obj1.focus();
		return false;
		}	
		
	}
	

 </script>
 </head>
 <body>
 <div id="header">
 <div id=center><img src="images/11111.jpg" width=300" height="50" border="0" alt=""></div>
 </div>
 <div id="main">
 <table align="center" id="myTable" border="1" cellspacing="0" cellpadding="0" width="500px">
 <form method="post" action="success.html" name="myForm">
 <tr>
	<td colspan="2" style="color:black; font-size:18px;"></td>
 </tr>
 <tr>
	<td class="righttd" >Email:</td>
	<td class="lefttd"><input type="text"  name="" class="inputs" id="email" value="请输入正确的电子邮箱" onFocus="clearText()" onblur="checkEmail()">
    <div id="showEmailError" class="red"></div>
	</td>
 </tr>
 <tr>
	<td class="righttd" >密码:</td>
	<td class="lefttd"><input type="password" class="inputs" id="pwd" value="请输入正确的密码" onFocus="clearText()" onBlur="checkpwd()">
     <div id="showEmailError" class="red"></div>
    </td>
 </tr>
 <tr>
    <td class="righttd">确认密码:</td>
    <td class="lefttd"><input type="password" class="inputs" id="confirm_pwd" value="请再次输入正确的密码" onFocus="clearText()"></td>
  </tr>
  <tr>
    <td class="righttd">请输入手机号</td>
    <td class="lefttd"><input type="text" class="inputs" id="user" value="请输入正确的手机号" onFocus="clearText1()" onBlur="checkuser()">
     <div id="showEmailError" class="red"></div>
    </td>
  </tr>
  <tr>
    <td class="righttd">输入短信验证码</td>
    <td class="lefttd"><input type="text" class="inputs" id="user" value="" onFocus="clearText1()" onBlur="checkuser()">
    <input name="" type="button" value="获取验证码">
     <div id="showEmailError" class="red"></div>
    </td>
  </tr>


 
	<td colspan="2" align="center"><input type="submit" value="登录" id="btnSubmit"></td>	
 </tr>
 </form>
 </table>
 </div>
 </body>
</html>
